<%@ page language="java"  pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	    <title><fmt:message key="policyDetail.heading"/></title>
	    	    <script type="text/javascript" src="${ctxPath}/resource/front/lib/jquery.bgiframe.min.js" ></script>
		<script type="text/javascript" src="${ctxPath}/resource/front/lib/jquery.ajaxQueue.js" ></script>
		<script type="text/javascript" src="${ctxPath}/resource/front/lib/thickbox-compressed.js" ></script>
		<script type="text/javascript" src="${ctxPath}/resource/front/lib/jquery.autocomplete.js" ></script>
	 	<script type="text/javascript" src="${ctxPath}/resource/admin/js/citys.js" ></script>
	 	<link rel="stylesheet" type="text/css" href="${ctxPath}/resource/front/lib/jquery.autocomplete.css" />
	 	<script type="text/javascript">
		$(function() {
			setEmptyCheck("flightCode:startdateTicket:enfdateTicket:startDate:endDate:beforeValidDay:dpt:arrCity:backNote:cabinNote");
			setMoneyCheck("returnPoint");
			setCheckEnglish("cabin");
			setPositiveNegative("returnPrice");
			applyDate("startdateTicket");
			applyDate("enfdateTicket");
			applyDate("startDate");
			applyDate("endDate");
			
		});
		function showDiscountType(type){
			if(type==1){
				$("#showDiscount").show();
				$("#showZpoint").hide();
			}if(type==2){
				$("#showDiscount").hide();
				$("#showZpoint").show();
			}
		}
		function setTavelDate(){
			if($("#like").attr("checked")){
				$("#startDate").val($("#startdateTicket").val());	
				$("#endDate").val($("#enfdateTicket").val());	
			}
		}
		function disabledFlight(obj){
			if(obj.value==1){
				$("#withIn").attr("disabled","disabled");
				$("#withOut").attr("disabled","disabled");
			}if(obj.value==2){
				$("#withIn").attr("disabled","disabled");
				$("#withOut").attr("disabled",false);
			}if(obj.value==3){
				$("#withOut").attr("disabled","disabled");
				$("#withIn").attr("disabled",false);
			}
		}
	 	</script>
  </head>
  <body>
  <form:form method="post" commandName="policy" action="editPolicy.do">	
	<form:hidden path="policyId"/>			
	<input name="policyType" value="1" type="hidden"/>			
		<ul>
	  <li class="titleonly"><img src="${ctxPath}/css/style/base/image/dot.gif" width="15" height="16" class="dot" />&gt;&gt;
	  添加普通政策<a href="javascript:history.back()"><img src="${ctxPath}/css/style/base/image/backtrack.gif" width="14" height="14" align="absmiddle" class="backtrack"/>返回</a></li>
	</ul>
	<ul>
	  <li class="listgrey"><span class="colorFF0000">&lowast;</span> 航空公司
	    <input id="flightCode" name="flightCode" value="${policy.flightCode }" type="text" class="inputbox60" maxlength="2" check=2 tip="一条政策只能对应一个航空公司，只支持航空公司二字码输入，如:CA"  /> 
		&nbsp;&nbsp;<font color="#999999">一条政策只能对应一个航空公司，只支持航空公司二字码输入，如:CA </font>
	  </li>
	  <li class="listwhile">&nbsp;&nbsp;&nbsp; 政策代码
		<input name="policyCode" value="${policy.policyCode}" type="text" class="inputbox60"  /> 
	  </li>
	  <li class="listgrey"><span class="colorFF0000">&lowast;</span> 销售期限
	 
	    <input id="startdateTicket" name="startdateTicket" check=2 tip="输入格式：YYYY-MM-DD" value="<fmt:formatDate value="${policy.startdateTicket}" pattern="yyyy-MM-dd"/>" type="text" class="inputbox85" />
		-	
		<input id="enfdateTicket" name="enfdateTicket" check=2 tip="输入格式：YYYY-MM-DD" value="<fmt:formatDate value="${policy.enfdateTicket}" pattern="yyyy-MM-dd"/>" type="text" class="inputbox85" />
		<input type="checkbox" name="checkbox"  onclick="setTavelDate()" class="check" id="like"/> 
		同旅行期限相同
		</li>
	  <li class="listwhile"><span class="colorFF0000">&lowast;</span> 旅行期限
	    <input id="startDate" name="startDate" check=2 tip="输入格式：YYYY-MM-DD" value="<fmt:formatDate value="${policy.startDate}" pattern="yyyy-MM-dd"/>"  type="text" class="inputbox85" />
		-
		<input id="endDate" name="endDate" check=2 tip="输入格式：YYYY-MM-DD" value="<fmt:formatDate value="${policy.endDate}" pattern="yyyy-MM-dd"/>" type="text" class="inputbox85" />
		<font color="#999999"> 输入格式：YYYY-MM-DD，如：2010-01-02 </font>
	  </li>
	  <li class="listgrey"><span class="colorFF0000">&lowast;</span> 出票时限
	    <input id="beforeValidDay" name="beforeValidDay" value="${policy.beforeValidDay}"  type="text" class="inputbox60"  check=2 tip="只能输入正整数，且必须大于等于0" />
		&nbsp;&nbsp;<font color="#999999">含当天，只能输入正整数，且必须大于等于0。 例如：提前出票时限为2，旅行有效期开始日期为2010-07-07，则最晚出票时间为2010-07-05。 </font>
	  </li>
	  <li class="listwhile"><span class="colorFF0000">&lowast;</span> 起飞机场
	    <input id="dpt" name="dpt" value="${policy.dpt}" type="text" class="inputbox120"  maxlength="3" check=2 tip="只支持一个起飞机场，输入只支持机场三字码，如PEK"  />
		<font color="#999999"> 只支持一个起飞机场，输入只支持机场三字码，如PEK  </font>
	  </li>
	  <li class="listgrey"><span class="colorFF0000">&lowast;</span> 到达机场
	    <input id="arrCity" name="arr" value="${policy.arr}" type="text" class="inputbox120"  maxlength="99" check=2 tip="仅普通政策支持多个到达机场，多个机场用,分隔，最多支持25个机场。特价、特殊政策只支持一个到达机场。"  />
		 <font color="#999999">仅普通政策支持多个到达机场，多个机场用","分隔，最多支持25个机场。特价、特殊政策只支持一个到达机场。 </font>
	  </li>
	  <li class="listwhile_1"><span class="colorFF0000">&lowast;</span> 班期限制
			<c:forEach var="day" items="${dayArry}">
 			<c:set var="checked" value="false"></c:set>
 			<c:forEach var="selectDay" items="${selectDayArry}">
 				<c:if test="${day==selectDay}">
 				<c:set var="checked" value="true"></c:set>
 				</c:if>	
 			</c:forEach>
 			<c:if test="${empty policy.policyId}">
 				<c:set var="checked" value="true"></c:set>
 			</c:if>	
 			<input type="checkbox" name="daycondition" class="check" <c:if test="${checked==true}">checked="checked" </c:if> value="${day}">${day}&nbsp;&nbsp;
 		</c:forEach>
		<font color="#999999">周一至周日,周日用7表示 </font>
	  </li>
	  <li class="listgrey"><span class="colorFF0000">&lowast;</span> 航班号码
	    <input type="radio" name="flightNumLimit" onclick="disabledFlight(this)" value="1" class="check" <c:if test="${empty policy.flightNumLimit || policy.flightNumLimit==1 }"> checked="checked"</c:if>/> 该航段全部航班
		&nbsp;&nbsp; / <input type="radio" name="flightNumLimit" onclick="disabledFlight(this)" value="2" class="check" <c:if test="${policy.flightNumLimit==2}"> checked="checked"</c:if>/> 该航段除了
		<input name="withOut" id="withOut" type="text" class="inputbox60" disabled="disabled" <c:if test="${policy.flightNumLimit==2}"> value=${policy.flightCondition}</c:if> /> 之外的航班
		&nbsp;&nbsp;  / <input type="radio"  name="flightNumLimit" onclick="disabledFlight(this)" value="3" class="check" <c:if test="${policy.flightNumLimit==3}"> checked="checked"</c:if>/> 仅以下航班
		<input name="withIn" id="withIn" type="text" class="inputbox60" disabled="disabled"  <c:if test="${policy.flightNumLimit==3}"> value=${policy.flightCondition}</c:if> />
		<font color="#999999">可多个航班号，用","分隔，如：CA1145, CA6524 </font>
	  </li>
		<li class="listwhile_1">&nbsp;&nbsp;支持代码共享航班
		<input type="radio" name="shared" value="1" <c:if test="${policy.shared==1}">checked="checked"</c:if> />是&nbsp;&nbsp;
		<input type="radio" name="shared" value="0" <c:if test="${empty policy.shared || policy.shared==0}">checked="checked"</c:if>/>否
		&nbsp;&nbsp;/&nbsp;&nbsp;自动出票
		<input type="radio" value="1" name="autoTicket" <c:if test="${policy.autoTicket==1}">checked="checked"</c:if>/>是
		<input type="radio"  value="0"  name="autoTicket" <c:if test="${empty policy.autoTicket || policy.autoTicket==0}">checked="checked"</c:if>/>否
	
		</li>	  
	  <li class="listgrey"><span class="colorFF0000">&lowast;</span> 适用舱位
	    <input id="cabin" name="cabin" value="${policy.cabin}" type="text" class="inputbox85" check=2 tip="仅普通政策允许多个舱位，多个舱位不需要分隔符，如：FCX "/>
		<font color="#999999">仅普通政策允许多个舱位，多个舱位不需要分隔符，如：FCX  </font>
	  </li>
	  <li class="listwhile"><span class="colorFF0000">&lowast;</span> 返还点数
	    <input id="returnPoint" name="returnPoint" value="${policy.returnPoint}" type="text" class="inputbox85" check="2" tip="只支持数字输入，精确到两位小数" /> %
		<font color="#999999">只支持数字输入，精确到两位小数，如：15.25，代表返点15.25 </font>
	  </li>
	  <li class="listgrey"><span class="colorFF0000">&lowast;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;留 钱&nbsp;
	   <input id="returnPrice" name="returnPrice" value="${policy.returnPrice}" type="text" class="inputbox85" check="2" tip="支持正负整数输入"/> 元
		<font color="#999999">支持正负整数输入 </font>
	  </li>
	 <%--  <li class="listwhile_1">成本价类型&nbsp;&nbsp;
	  <input type="radio" name="discountType" <c:if test="${empty policy.discountType || policy.discountType==1}">checked="checked"</c:if> onclick="showDiscountType(1)" value="1"/>指定成本价
	&nbsp;&nbsp;<input type="radio" name="discountType" <c:if test="${policy.discountType==0}">checked="checked"</c:if> onclick="showDiscountType(2)" value="0"/>指定代理费率 
	  </li>
	  <li class="listgrey" id="showDiscount" <c:if test="${policy.discountType==0}">style="display: none;"</c:if>><span class="colorFF0000">&lowast;</span>&nbsp;成本价格
	     <input id="discountValue" name="discountValue" value="${policy.discountValue}" type="text" class="inputbox85" />
	  </li>
	  <li class="listgrey" id="showZpoint" <c:if test="${empty policy.discountType || policy.discountType==1}">style="display: none;"</c:if>><span class="colorFF0000">&lowast;</span>&nbsp;&nbsp;&nbsp;
  	基础代理费率/z值 <input id="proxyPrice" name="proxyPrice" value="${policy.proxyPrice}" type="text" class="inputbox85" />
         后返 <input id="backPrice" name="backPrice" value="${policy.backPrice}" type="text" class="inputbox85" />
	  </li> --%>
	  <li class="listwhile_1"><span class="colorFF0000">&lowast;</span>&nbsp;&nbsp;&nbsp;退改签
	    <textarea id="backNote" name="backNote"  class="inputboxminilarge"  check=2 tip="不能为空">${policy.backNote}</textarea>
	  </li>
	 <li class="listwhile_1"><span class="colorFF0000">&lowast;</span> 舱位说明
	      <textarea id="cabinNote" name="cabinNote"  class="inputboxminilarge" check=2 tip="不能为空 ">${policy.cabinNote}</textarea>
	  </li> 
	   <li class="listwhile">政策状态：<fmt:message key="policy.status${policy.status}"></fmt:message>
	   <input type="hidden" value="1" name="status">
	  </li>
	  <li class="listwhile">
	    <input name="Submit2" type="button" onclick="javascript:history.back()" class="inputsubmit" value="返回" />
		<input name="Submit2" type="submit" class="inputsubmit" value="添加" />
	  </li>
	</ul>
	</form:form>
  </body>
</html>